package com.itheima.demo;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo05 {//字节流写数据换行加续写
    public static void main(String[] args) throws IOException {
        //创建字节流写对象,true表示开启续写开关
        FileOutputStream fos = new FileOutputStream("D:\\demo\\a.txt",false);

        //换行加续写
        fos.write(97);
        fos.write("\r".getBytes());
        fos.write(98);
        fos.write("\n".getBytes());
        fos.write(99);
        fos.write("\r\n".getBytes());
        fos.write(100);
        fos.write("\n".getBytes());

        //关闭资源
        fos.close();
    }
}
